Expand description
Source positions and related helper functions.
Macros§
- format_
atom - Creates an
Atomusing interpolation of runtime expressions. - format_
compact_ str - Creates a
CompactStrusing interpolation of runtime expressions.
Structs§
- Atom
- An inlinable string for oxc_allocator.
- Compact
Str - Lifetimeless version of
crate::Atomwhich owns its own string data allocation. - Source
Type - Source Type for JavaScript vs TypeScript / Script vs Module / JSX
- Span
- A range in text, represented by a zero-indexed start and end offset.
- Unknown
Extension - Error returned by
SourceType::from_pathandSourceType::from_extensionwhen the file extension is not found or recognized.
Enums§
- File
Extension - Valid file extension.
- Language
- JavaScript or TypeScript
- Language
Variant - JSX for JavaScript and TypeScript
- Module
Kind - Script or Module
Constants§
- ATOM_
MAX_ INLINE_ LEN - Maximum length for inline string, which can be created with
CompactStr::new_const. - SPAN
- An empty span.
- VALID_
EXTENSIONS - Valid file extensions.
Traits§
- Content
Eq - This trait works similarly to PartialEq but it gives the liberty of checking the equality of the content loosely.
- GetSpan
- Get the span for an AST node.
- GetSpan
Mut - Get mutable ref to span for an AST node.